<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>项目列表</title>
    <?php require 'templates/common/head.html'; ?>
    <style type="text/css">
       .form_d{
           width:800px;
           margin: 20px auto;
       }
        .form_d input{
            height: 35px;
        }
    </style>
</head>
<body>

<!-- 配置文件 -->
<script type="text/javascript" src="../business/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../business/ueditor/ueditor.all.min.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container', {
        toolbars: [
            [ 'fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                'directionalityltr', 'directionalityrtl', 'indent', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|','link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                'simpleupload', 'insertimage', 'emotion', 'scrawl', 'attachment', 'map', 'gmap', 'insertframe']
        ],
        autoHeightEnabled: true,
        autoFloatEnabled: true
    });
</script>

<div class="container-fluid">
    <?php require 'templates/common/nav.html'; ?>
    <div class="panel panel-primary">
        <div class="panel-heading text-center">
            <h3 class="panel-title"><?php if(isset($course))echo "编辑";else echo "添加";?>视频课程</h3>
        </div>

        <div class="form_d">
            <form action="" method="post">
                昵称:<input type="text" name="name" id="namese" style="width: 120px">
                <input type="button" onclick="selectshow()" name="select" value="搜索用户">

            </form>
        </div>

        <form action="index.php?m=video_course&a=addVideo_post" method="post">
            <input type="hidden" name="id" value="<?=$course['id']?>" />
            <div class="form_d"><span style="width: 180px">用   户:</span>
                <div id="xianshi">
                    <?php  if($course):?>
                    <input type="radio" checked="checked" value="<?=$course['讲课专家id']?>" name="专家id">
                    <?=$course['name']?>（<?=$course['医院']?>）
                    <?php  endif;?>
                </div>
            </div>
            <div class="form_d">
                <span>推送主题:</span>
                <input style="width: 80%;" type="text" name="theme" value="<?=@$course['theme']?>">
            </div>
            <div class="form_d">
                <span>标题:</span>
                <input style="width: 80%;" type="text" name="title" value="<?=@$course['title']?>">
            </div>
            <div class="form_d">
                <span>是否是测试数据:</span>
                <input style="" type="radio" name="is_test" value="0" checked>否&nbsp;&nbsp;
                <input style="" type="radio" name="is_test" value="1" <?php if($course['is_test']==1) echo checked; ?>>是
            </div>
            <!--<div class="form_d">-->
                <!--<span>课程提醒模板ID:</span>-->
                <!--<input style="width: 80%;" type="text" name="咨询模板ID" value="<?=@$course['咨询模板ID']?>">-->
            <!--</div>-->
            <!--<div class="form_d">-->
                <!--<span>课程开课通知模板ID:</span>-->
                <!--<input style="width: 80%;" type="text" name="course_notice_templateId" value="<?=@$course['course_notice_templateId']?>">-->
            <!--</div>-->
            <div class="form_d">
                <span>课堂人数上限:</span><!-- 加载编辑器的容器 -->
                <input type="text" placeholder="最多报名人数，默认没有人数限制" name="课堂人数上限" value="<?=@$course['课堂人数上限']?>"/>
            </div>
            <div class="form_d">
                <span>时间:</span>
                <input type="text" name="开始时间" placeholder="2016-01-12 20:00" value="<?=@$course['开始时间']?>">~
                <input type="text" name="结束时间" placeholder="2016-01-12 22:00" value="<?=@$course['结束时间']?>">
            </div>
            <div class="form_d">
                <span>视频url:</span><!-- 加载编辑器的容器 -->
                <textarea name="url"  style="width: 90%"><?=@$course['视频url']?></textarea>
            </div>

            <div class="form_d">
                <span>简介:</span>
                <textarea name="简介" style="width: 90%"><?=@$course['简介']?></textarea>
            </div>
            <div class="form_d">
                <span>房间号:</span>
                <input type="text" name="chatId" value="<?=@$course['chatId']?>"/>
            </div>
            <div class="form_d">
                <span>标签:</span>
                <select name="sign_id">
                    <option value="">====选择====</option>
                    <?php foreach($signList as $item):?>
                    <option value="<?=$item['id']?>" <?php if($item['id'] == $course['sign_id']):?>selected="selected"<?php endif;?> ><?=$item['name']?></option>
                    <?php endforeach;?>
                </select>
            </div>
            <div class="form_d">
                <span>内容:</span><!-- 加载编辑器的容器 -->
                <script id="container" name="content" type="text/plain" style="height: 400px;" ><?=@$course['详情']?></script>
            </div>
            <div class="form_d">
                <input id="tijiao" type="submit" name="okn" value="提交">
                <a href="index.php?m=video_course">查看历史</a>
            </div>
        </form>
        <!--<div class="form_d">-->
            <!--<form action="" method="post">-->
                <!--请输入课程标题：<input type="text" name="content" >-->
                <!--<input type="submit" id="end" name="end" value="发布">-->
            <!--</form>-->
        <!--</div>-->
    </div>

</div>
<script src="../business/resource/js/jquery-1.11.1.min.js"></script>
<script language="JavaScript">
    function selectshow(){
        var name= document.getElementById("namese").value;
        $.post('index.php?m=video_course&a=find_user',{name:name},function(data) {
            document.getElementById('xianshi').innerHTML='';
            document.getElementById("xianshi").innerHTML=data;

        });

    }
$(function(){
    $("#end").click(function(){
        $(this).attr('hidden',true);
    });
    $("#tijiao").click(function(){
        $(this).attr('hidden',true);
    });
})

</script>
<?php require 'templates/common/foot.html'; ?>
</body>
</html>

